package com.aracky.flowable.utils;

import com.aracky.common.vo.PageVO;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;

/**
 * @Author zengzhiping
 * @BelongsPackage com.aracky.flowable.utils
 * @CreateTime 2022-08-18
 * @Description
 */
public class PageUtil {

    /**
     * 构造特殊分页信息
     *
     * @param page
     * @param size
     * @param count
     * @param dataList
     * @return
     */
    public static <T>PageVO<T> buildPage(int page, int size, long count, List<T> dataList) {
        //构造分页信息
        PageVO<T> pageVO = new PageVO();
        pageVO.setPage(Long.valueOf(page));
        pageVO.setSize(Long.valueOf(size));
        pageVO.setTotalPage(count / size);
        pageVO.setTotalCount(count);
        pageVO.setData(dataList);
        return pageVO;
    }

}
